import request from '@/utils/request'

// 拿到权限列表
export const getPermission = () => {
  return request.get('/sys/permission')
}

// 增加权限
export const addPermission = (obj) => {
  return request.post('/sys/permission', {
    ...obj
  })
}

// 删除权限
export const delPermission = (id) => {
  return request.delete(`/sys/permission/${id}`)
}

// 编辑1：获取权限id的详情
export const getPer = (id) => {
  return request.get(`/sys/permission/${id}`)
}

// 2 编辑
export const editPer = (obj) => {
  return request.put(`/sys/permission/${obj.id}`, {
    ...obj
  })
}
